<template>
<div class="advanced-search-box">
    <div class="msg-content">
      {{msg}}
    </div>
    <div class="foot-btn-box">
      <!-- <RPButton btnType="default" text="取消" @click="handleClose"/> -->
      <RPButton btnType="default" text="保存" @click="handleSave"/>
      <RPButton btnType="primary" text="前往提交" @click="handleSaveAndSubmit"/>
    </div>
</div>
</template>
<script>
import {
  ACTION_BUTTON_SAVE,
  ACTION_BUTTON_SAVE_AND_SUBMIT,
} from '../const.js'
export default {
  name: 'editRuleConfigConfirm',
  props: {
    data: {
      type: Object,
      default: () => {}
    },
  },
  data() {
    return {
      info: {}
    }
  },
  computed: {
    msg() {
      return `未提交的规则组不会生效，您需要提交此规则组吗？`
    }
  },
  created() {
     this.$emit("SetTitle", "温馨提示");
     this.$emit("SetPageMinHeight", 100);
     this.$emit("SetPageWidth", 500);
     this.info = {...this.data}
  },
  methods: {
    handleClose() {
      this.$emit("Close", false);
    },
    // 保存
    handleSave() {
      this.info.optType = ACTION_BUTTON_SAVE
      this.$emit("Close", this.info)
    },
    // 保存并提交
    handleSaveAndSubmit() {
      this.info.optType = ACTION_BUTTON_SAVE_AND_SUBMIT
      this.$emit("Close", this.info)
    },
  }
}
</script>
<style lang="less" scoped>
.core-modal-footer {
  padding: 0;
}
.advanced-search-box {
  .foot-btn-box {
    padding-top: 30px;
    text-align: right;
    button {
      margin-left: 10px;
    }
  }
}
</style>

